package com.songtech.auth.user.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.songtech.auth.role.model.Role;

@Entity
@Table(name = "user")
public class User implements Serializable{
	@Transient
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "id")
	private String id;
	/**
	 * 登录名
	 */
	@Column(name = "login_name")
	private String loginName;
	@Column(name = "password")
	private String password;
	/**
	 * 用户姓名
	 */
	@Column(name = "user_name")
	private String userName;
	@Column(name = "sex")
	private String sex;
	@Column(name = "phone")
	private String phone;
	@Column(name = "email")
	private String email;
	/**
	 * 用户标识，可扩展字段（部门、区域等）
	 */
	@Column(name = "code")
	private String code;
	@Column(name = "is_valid")
	private int isValid;
	/**
	 * 新增时间
	 */
	@Column(name= "create_time")
	private Date createTime;
	/**
	 * 新增人
	 */
	@Column(name= "create_user")
	private String createUser;
	/**
	 * 修改时间
	 */
	@Column(name= "update_time")
	private Date updateTime;
	/**
	 * 修改人
	 */
	@Column(name= "update_user")
	private String updateUser;

	@Column(name="company_id")
	private String companyId;
	/**
	 * 拥有的角色
	 */
	@Transient
	List<Role> roles;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public int getIsValid() {
		return isValid;
	}
	public void setIsValid(int isValid) {
		this.isValid = isValid;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public void setCompanyId(String companyId){
		this.companyId = companyId;
	}
	public String getCompanyId(){
		return companyId;
	}
}
